home *** CD-ROM | disk | FTP | other *** search
/ Imagine the Possibilitieā€¦Pentium Processor Demos 3 / Intel - Imagine the Possibilities - Processor Demos for Resellers Vol 3.iso / vfw / mssetup.mst < prev    next >
Text File  |  1995-07-25  |  12KB  |  318 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19. CONST SPI_SETSCREENSAVEACTIVE    = 17
  20. CONST SPIF_UPDATEINIFILE        = 1
  21. CONST SPIF_SENDWININICHANGE        = 2
  22.  
  23. ''Bitmap ID
  24. CONST LOGO = 1
  25.  
  26. GLOBAL SizeReq&  '' Total Disk Size required for installation
  27.  
  28. ''File Types
  29. GLOBAL WinDir$
  30. GLOBAL WinSysDir$
  31. GLOBAL WinSys32Dir$
  32. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  33. GLOBAL CHECKSTATES$
  34. GLOBAL MinorVer%
  35. GLOBAL OnNT$
  36.  
  37. DECLARE SUB Install
  38. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  39. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  40. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  41. DECLARE SUB Reboot LIB "iniupd.dll"
  42. DECLARE FUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  43. DECLARE FUNCTION ShowWindow LIB "User" ( hwnd%, state% ) AS INTEGER
  44. DECLARE FUNCTION SystemParametersInfo LIB "User" ( uAction%, uParam%, lpvParam&, ufuWinIni% ) AS INTEGER
  45.  
  46. Dim pNull as LONG
  47.  
  48. INIT:
  49.   
  50.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  51.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  52.     
  53.     WIN32ENABLED% = 0
  54.     MajorVer% = GetWindowsMajorVersion()
  55.     MinorVer% = GetWindowsMinorVersion()
  56.     Processor% = GetProcessorType()
  57.     WinDir$ = GetWindowsDir()
  58.     DEST$ = GetWindowsDir()
  59.     WinSysDir$ = GetWindowsSysDir()
  60.     WinSys32Dir$ = WinDir$ + "system32"
  61.  
  62.     ''
  63.     '' Disable Screen savers (DPM Added 07-07-95)
  64.     ''
  65.     i% = SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, 0, pNull, SPIF_UPDATEINIFILE or SPIF_SENDWININICHANGE )
  66.  
  67.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  68.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  69.     END
  70.     END IF
  71.  
  72.     'Prevents installation on 286
  73.     IF Processor% < 3 THEN
  74.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  75.     END
  76.     END IF
  77.  
  78.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  79.     IF OnWindowsNT() THEN
  80.       OnNT$ = "TRUE"
  81.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  82.       IF WowVersion$ = "" THEN
  83.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  84.          END
  85.       END IF
  86.     END IF
  87.  
  88.     MainWnd% = HwndFrame()
  89.     i% = ShowWindow( MainWnd%, 3 )
  90.     SetBitmap CUIDLL$, LOGO
  91.     SetTitle "Video for Windows 1.1e Runtime"
  92.  
  93.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  94.     IF szInf$ = "" THEN
  95.        szInf$ = GetSymbolValue("STF_CWDDIR") + "MSSETUP.INF"
  96.     END IF
  97.     ReadInfFile szInf$
  98.  
  99.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  100.  
  101. WELCOME:
  102. ''    sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  103. ''    IF sz$ = "CONTINUE" THEN
  104. ''       UIPop 1
  105. ''     ELSE
  106. ''    GOSUB ASKQUIT
  107. ''    GOTO WELCOME
  108. ''    END IF
  109.  
  110. ''Prepare Copy list and check size
  111.  
  112.     ClearCopyList
  113.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  114.  
  115. '' Remove DCISVGA file
  116.     AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
  117.  
  118. ''  Runtime files (on Windows disk)
  119. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  120.  
  121.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN            'These files not necessary on Windows NT
  122.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  123.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  124.     END IF
  125.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  126.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  127.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  128.     IF OnNT$ = "TRUE" THEN
  129.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  130.     ENDIF
  131. ''*************************************************************************************************************************
  132. ''*************************************************************************************************************************
  133. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  134. ''and add a "DCI Provider" section with to the SETUP.INF file.
  135. ''
  136. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  137. ''*************************************************************************************************************************
  138. ''*************************************************************************************************************************
  139.  
  140. ''  Check windrive diskspace
  141.     SizeReq& = GetCopyListCost ("","", "")
  142.     IF SizeReq& <> 0 THEN
  143.     GOSUB SMALLWIN
  144.     END
  145.     END IF
  146.  
  147. Install
  148.  
  149. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  150. '' else, it gives the user the choice
  151.     RESTRT% = RestartListEmpty ()
  152.     Exe$ = DEST$ + "\_msrstrt.exe"
  153.     Batch$ = DEST$ + "\_mssetup.bat"
  154.     empty$ = ""
  155. RESTART:
  156.     ''
  157.     '' Re-enable Screen savers (DPM Added 07-07-95)
  158.     ''
  159.     i% = SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, -1, pNull, SPIF_UPDATEINIFILE or SPIF_SENDWININICHANGE )
  160.  
  161.     IF RESTRT% = 0 THEN
  162. ''       sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  163. ''       IF sz$ = "REACTIVATE" THEN
  164. ''      GOTO RESTART
  165. ''       ENDIF
  166.        I% = ExitExecRestart ()
  167.        RemoveFile Exe$, cmoForce
  168.        RemoveFile Batch$, cmoForce
  169.        END
  170.     ELSE
  171. ''       sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  172. ''       IF sz$ = "CONTINUE" THEN
  173.       I% = ExitWindowsExec (Exe$, empty$)
  174. ''         IF I% = 0 THEN
  175. ''         GOTO RESTART
  176. ''      ELSE
  177. ''         END
  178. ''     ENDIF
  179. ''       ELSEIF sz$ = "EXIT" THEN
  180. ''      UIPopAll
  181. ''      END
  182. ''       ELSEIF sz$ = "REACTIVATE" THEN
  183. ''      GOTO RESTART
  184. ''       ELSE
  185. ''      UIPop 1
  186. ''       END IF
  187.     END IF
  188.  
  189.  
  190. QUIT:
  191.     ON ERROR GOTO ERRQUIT
  192.  
  193.     IF ERR = 0 THEN
  194.     dlg% = EXITSUCCESS
  195.     ELSEIF ERR = STFQUIT THEN
  196.     dlg% = EXITQUIT
  197.     ELSE
  198.     dlg% = EXITFAILURE
  199.     END IF
  200. QUITL1:
  201.     i% = SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, -1, pNull, SPIF_UPDATEINIFILE or SPIF_SENDWININICHANGE )
  202.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  203.     IF sz$ = "REACTIVATE" THEN
  204.     GOTO QUITL1
  205.     END IF
  206.     UIPop 1
  207.     END
  208.  
  209. ERRQUIT:
  210.     i% = DoMsgBox("An installation problem occurred, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  211.     END
  212.  
  213.  
  214. ASKQUIT:
  215.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  216.  
  217.     IF sz$ = "EXIT" THEN
  218.     UIPopAll
  219. ''        ERROR STFQUIT
  220.     END
  221.     ELSEIF sz$ = "REACTIVATE" THEN
  222.     GOTO ASKQUIT
  223.     ELSE
  224.     UIPop 1
  225.     END IF
  226.     RETURN
  227.  
  228. SMALLWIN:
  229.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  230.     IF sz$ = "REACTIVATE" THEN
  231.     GOTO SMALLWIN
  232.     END IF
  233.     UIPop 1
  234.     RETURN
  235.  
  236. '**
  237. '** Purpose:
  238. '**     Performs all installation operations.
  239. '** Arguments:
  240. '**     none.
  241. '** Returns:
  242. '**     none.
  243. '*************************************************************************
  244. SUB Install STATIC
  245.  
  246.     SetRestartDir WinDir$
  247.     CopyFilesInCopyList
  248.  
  249. ''Updating WIN.INI and SYSTEM.INI
  250. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  251.  
  252. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  253.     IF VflatdPresent() = 0 THEN
  254.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  255.     END IF
  256. END IF
  257.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  258.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  259.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  260.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  261.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  262.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  263.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  264.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  265.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  266.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  267.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  268.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  269.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  270.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  271.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  272.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  273.  
  274. ''*************************************************************************************************************************
  275. ''*************************************************************************************************************************
  276. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the    <provider> with your own file name
  277. ''
  278. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  279. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  280. ''*************************************************************************************************************************
  281. ''*************************************************************************************************************************
  282.  
  283. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  284. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  285.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  286.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  287.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  288.  
  289. '' Mplayer
  290.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  291.  
  292. END IF    ''NT and next version of Windows installation stop here.
  293.  
  294.     Run ("profdisp.exe")   
  295. END SUB
  296.  
  297. '**
  298. '** Purpose:
  299. '**     Appends a file name to the end of a directory path,
  300. '**     inserting a backslash character as needed.
  301. '** Arguments:
  302. '**     szDir$  - full directory path (with optional ending "\")
  303. '**     szFile$ - filename to append to directory
  304. '** Returns:
  305. '**     Resulting fully qualified path name.
  306. '*************************************************************************
  307. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  308.     IF szDir$ = "" THEN
  309.     MakePath = szFile$
  310.     ELSEIF szFile$ = "" THEN
  311.     MakePath = szDir$
  312.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  313.     MakePath = szDir$ + szFile$
  314.     ELSE
  315.     MakePath = szDir$ + "\" + szFile$
  316.     END IF
  317. END FUNCTION
  318.